/******************************************************************************

                                SPEDEN.H

  Title:  Include file for Electron Density Calculation by Holographic 
	  Reconstruction: main data structures used by Back and Solve.
  Author:  Hanna Szoke
  Date:  1/10/92

******************************************************************************/

#include "util.h"		/* general definitions */
#include "cellparams.h"		/* a, b, c, angles, crystal_symmetry */
#include "symmetry.h"		/* symmetry groups supported by Speden */
#include "dims.h"		/* grid_type, Np, and other dimensions */

#define MAXCONSTR	12	/* max. no. of constraints for a problem */
#define DISCRP	1.e-4		/* discrepancy parameter used in 'funct' */
#define  EPS_PHI 1.e-10		/* cutoff angle for gradient exception 
				   processing 	*/

enum ctype {CS, PHASE_EXT, PROJECTION, TARGET} ;

        /*      Input and derived parameters.   */

extern	float	R_stop ;	/* R_factor at which code should stop	*/
extern  real  discrp_frac ;   /* fraction of DISCRP set by user (def: 1) */
extern	int	robust ;	/* use robust hkl cost function? (T/F) */
extern	real	rob_factor ;	/* factor to use with robust cost function */

extern	char	fo_filename[] ;/* name of file, observed structure factors */
extern	char	md_filename[] ;/* name of bin. file, model electrons */

extern	int	Nconstraints ;	/* number of constraints */
extern	int	Ntargets ;	/* number of target constraints */
extern	int	con_type[] ;	/* target type: 1 of the ctype (see above) */
extern	real	relwt_con[] ;	/* relative weight for a constraint */
extern	real	cost_addend[] ;	/* constant factor in the cost function */
extern	real	con_coef[] ;	/* coefficient for cost function calc. */
extern	char	ta_filename[][MAXSTRING] ;/* target file for target constraint */
extern	char	wt_filename[][MAXSTRING] ;/* weight file for target constraint */
extern	char	fc_filename[][MAXSTRING] ;/* fcalc file, phase extension   */
extern	int	thereis_phext ;
extern	real	phase_ext_res ;		/* low resolution for phase ext */
extern	real    ph_coef ;
extern	real	ar_min, ar_max ;

	/* Widely-used arrays in (hkl) space.  */

extern	char	*maskfc ;	/* mask for fcalc	*/
extern	real  *hkl_weight ;	/* weights for (hkl) in half-ellipsoid */
extern	real	*expfac ;       /* exponential factors for convolution */
